 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.





Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKDatastar/DatastarModel.h>

@implementation RegionIndustryData
-(id) initWithRegion:(NSString*) region
      industry:(NSString*)industry
      firstIndex:(NSString*)firstIndex
      secondIndex:(NSString*)secondIndex
      dateTime:(NSString*)dateTime
      dateType:(NSString*)dateType
      indexValue:(NSString*)indexValue
      valueUnit:(NSString*)valueUnit
      attrType:(NSString*)attrType
      attrValue:(NSString*)attrValue
      attrValueExt:(NSString*)attrValueExt { 
     self.region = region;               
     self.industry = industry;               
     self.firstIndex = firstIndex;               
     self.secondIndex = secondIndex;               
     self.dateTime = dateTime;               
     self.dateType = dateType;               
     self.indexValue = indexValue;               
     self.valueUnit = valueUnit;               
     self.attrType = attrType;               
     self.attrValue = attrValue;               
     self.attrValueExt = attrValueExt;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self region])
    {
        [result setValue:[self region] forKey:@"region"];
    }
    if([self industry])
    {
        [result setValue:[self industry] forKey:@"industry"];
    }
    if([self firstIndex])
    {
        [result setValue:[self firstIndex] forKey:@"firstIndex"];
    }
    if([self secondIndex])
    {
        [result setValue:[self secondIndex] forKey:@"secondIndex"];
    }
    if([self dateTime])
    {
        [result setValue:[self dateTime] forKey:@"dateTime"];
    }
    if([self dateType])
    {
        [result setValue:[self dateType] forKey:@"dateType"];
    }
    if([self indexValue])
    {
        [result setValue:[self indexValue] forKey:@"indexValue"];
    }
    if([self valueUnit])
    {
        [result setValue:[self valueUnit] forKey:@"valueUnit"];
    }
    if([self attrType])
    {
        [result setValue:[self attrType] forKey:@"attrType"];
    }
    if([self attrValue])
    {
        [result setValue:[self attrValue] forKey:@"attrValue"];
    }
    if([self attrValueExt])
    {
        [result setValue:[self attrValueExt] forKey:@"attrValueExt"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.region = [dictionary objectForKey:@"region"];
    self.industry = [dictionary objectForKey:@"industry"];
    self.firstIndex = [dictionary objectForKey:@"firstIndex"];
    self.secondIndex = [dictionary objectForKey:@"secondIndex"];
    self.dateTime = [dictionary objectForKey:@"dateTime"];
    self.dateType = [dictionary objectForKey:@"dateType"];
    self.indexValue = [dictionary objectForKey:@"indexValue"];
    self.valueUnit = [dictionary objectForKey:@"valueUnit"];
    self.attrType = [dictionary objectForKey:@"attrType"];
    self.attrValue = [dictionary objectForKey:@"attrValue"];
    self.attrValueExt = [dictionary objectForKey:@"attrValueExt"];
    return self;
}
 @end
@implementation TestOpenApiReq
-(id) initWithName:(NSString*) name { 
     self.name = name;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self name])
    {
        [result setValue:[self name] forKey:@"name"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.name = [dictionary objectForKey:@"name"];
    return self;
}
 @end
@implementation RegionIndustryDataList
-(id) initWithDataList:(NSArray<RegionIndustryData*>*) dataList { 
     self.dataList = dataList;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self dataList])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self dataList] count]; i++) {
            RegionIndustryData* item = [[self dataList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"dataList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* dataListArray = [dictionary objectForKey:@"dataList"];
    if(dataListArray&&![dataListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [dataListArray count];i++)
        {
            RegionIndustryData* item = [[RegionIndustryData alloc]initWithDic:[dataListArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.dataList = propertyArray;
    }
    return self;
}
 @end
 
 


